<template>
  <div class="">
    <slot name="main">
      <div class="iconic" v-show="icont">
        <div class="top" @click="iconts">
          <van-icon name="cross" />
        </div>
        |
        <div class="iconsed">
          <br />
          <div class="bottoms">
            <p style="color: red">会员分享</p>
            <p style="color: red">￥98</p>
            <p style="color: #ccc">下单即返佣金</p>
          </div>
          <p @click="showShares">立即分享</p>
        </div>
      </div>
      <van-share-sheet
        v-model="showShare"
        title="立即分享给好友"
        :options="options"
      />
    </slot>
  </div>
</template>
<script>
export default {
  data() {
    return {
      // 图标
      icont: true,
      // 分享
      showShare: false,
      // 分享
      options: [
        { name: "微信", icon: "wechat" },
        { name: "微博", icon: "weibo" },
        { name: "复制链接", icon: "link" },
        { name: "分享海报", icon: "poster" },
        { name: "二维码", icon: "qrcode" },
      ],
    };
  },
  methods: {
    // 点击隐藏图标
    iconts() {
      this.icont = false;
    },
    showShares() {
      this.showShare = true;
    },
  },
};
</script>
<style lang="less" scoped>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
// 图标
.iconic {
  width: 80px;
  height: 150px;
  position: fixed;
  bottom: 15%;
  margin-left: 5%;
  text-align: center;
  border-radius: 5px;
  .top {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    font-size: 20px;
    margin-left: 37%;
    margin-top: 5%;
  }
  .iconsed {
    background: red;
    height: 105px;
    border-radius: 5px;
    color: white;
    p {
      margin-top: 5%;
    }
    .bottoms {
      border-radius: 5px;
      width: 90%;
      margin-left: 5%;
      background: white;
      font-size: 15px;
      font-size: 10px;
    }
  }
}
</style>
